﻿
namespace Patterns4Net.Tests.ArchitectureExplorer.Views.Utils
{
    using NUnit.Framework;
    using Patterns4Net.ArchitectureExplorer.Views.Utils;

    [TestFixture]
    public class CodeTextBlockTest
    {
        [Test]
        public void TrimLines_Trims_Leading_Tab()
        {
            var text = "\tvar variable = 8;\n" +
                       "\tif (variable == 3) \n" +
                       "\t\tDoSomething();";
            var resultLines = CodeTextBlock.TrimLines(text).Split('\n');

            Assert.IsTrue(resultLines[0].StartsWith("var"));
            Assert.IsTrue(resultLines[1].StartsWith("if"));
            Assert.IsTrue(resultLines[2].StartsWith("  Do"));
        }
    }
}
